<?php
$fp=fopen("./counter.txt","r+");
$number=fgets($fp,80);
$counter=intval($number)+1;
fseek($fp,0);
fputs($fp,$counter);
fclose($fp);
$n=strlen($counter);
$str="";
for($i=0;$i<$n;$i++)
{
    $m=substr($counter,$i,1);
    $str.="<img src='images/".$m.".gif' width='30' height='40'>";
}
echo "<h4>您是第".$str."个访客</h4>";
?>